Optimal. Leaf size=54 \[ -\frac{(a-b)^2 \cos (e+f x)}{f}+\frac{2 b (a-b) \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.045866, antiderivative size = 54, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.095, Rules used = {3664, 270} \[ -\frac{(a-b)^2 \cos (e+f x)}{f}+\frac{2 b (a-b) \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3664
Rule 270
Rubi steps
\begin{align*} \int \sin (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a-b+b x^2\right )^2}{x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (2 (a-b) b+\frac{(a-b)^2}{x^2}+b^2 x^2\right ) \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac{(a-b)^2 \cos (e+f x)}{f}+\frac{2 (a-b) b \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f}\\ \end{align*}
Mathematica [A] time = 0.289056, size = 48, normalized size = 0.89 \[ \frac{b \sec (e+f x) \left (6 a+b \sec ^2(e+f x)-6 b\right )-3 (a-b)^2 \cos (e+f x)}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.049, size = 125, normalized size = 2.3 \begin{align*}{\frac{1}{f} \left ( -{a}^{2}\cos \left ( fx+e \right ) +2\,ab \left ({\frac{ \left ( \sin \left ( fx+e \right ) \right ) ^{4}}{\cos \left ( fx+e \right ) }}+ \left ( 2+ \left ( \sin \left ( fx+e \right ) \right ) ^{2} \right ) \cos \left ( fx+e \right ) \right ) +{b}^{2} \left ({\frac{ \left ( \sin \left ( fx+e \right ) \right ) ^{6}}{3\, \left ( \cos \left ( fx+e \right ) \right ) ^{3}}}-{\frac{ \left ( \sin \left ( fx+e \right ) \right ) ^{6}}{\cos \left ( fx+e \right ) }}- \left ({\frac{8}{3}}+ \left ( \sin \left ( fx+e \right ) \right ) ^{4}+{\frac{4\, \left ( \sin \left ( fx+e \right ) \right ) ^{2}}{3}} \right ) \cos \left ( fx+e \right ) \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.979617, size = 96, normalized size = 1.78 \begin{align*} \frac{6 \, a b{\left (\frac{1}{\cos \left (f x + e\right )} + \cos \left (f x + e\right )\right )} - b^{2}{\left (\frac{6 \, \cos \left (f x + e\right )^{2} - 1}{\cos \left (f x + e\right )^{3}} + 3 \, \cos \left (f x + e\right )\right )} - 3 \, a^{2} \cos \left (f x + e\right )}{3 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.96447, size = 136, normalized size = 2.52 \begin{align*} -\frac{3 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} - 6 \,{\left (a b - b^{2}\right )} \cos \left (f x + e\right )^{2} - b^{2}}{3 \, f \cos \left (f x + e\right )^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \sin{\left (e + f x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.76229, size = 127, normalized size = 2.35 \begin{align*} -\frac{a^{2} f^{3} \cos \left (f x + e\right ) - 2 \, a b f^{3} \cos \left (f x + e\right ) + b^{2} f^{3} \cos \left (f x + e\right )}{f^{4}} + \frac{6 \, a b \cos \left (f x + e\right )^{2} - 6 \, b^{2} \cos \left (f x + e\right )^{2} + b^{2}}{3 \, f \cos \left (f x + e\right )^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]